import { postRequest, getRequest } from '@/utils/request.js';

/**
 * @Description: 健步走
 * @Author: linmei
 */
export const activityApi = {
  // 首页置顶活动
  getTopActivityList: () => {
    return getRequest('/wx/index/top/activity');
  },
  // 分页查询列表
  queryList: (param) => {
    return getRequest('/events/activity_brisk_walk/page', param);
  },
  // 参与活动
  getActivityJoin:(id) =>{
  	return getRequest(`/events/activity_brisk_walk/join/${id}`);
  },
  // 游客参与活动 
  getTouristJoin: (param) => {
    return postRequest('/events/activity_brisk_walk/join/new/user', param);
  },
  //查询详情
  getDetail:(id) =>{
	return getRequest(`/events/activity_brisk_walk/${id}`);
  },
  // 获取微信用户的步数
  getRunCount: (param) => {
    return postRequest('/events/activity_brisk_walk/get/run/count', param);
  },
  // 竞赛地图
  getCompetitionMap:(id) =>{
  	return getRequest(`/events/activity_brisk_walk/view/competition/map/${id}`);
  },
  // 健步走解锁
  getUnlockMap:(id, siteId) =>{
  	return getRequest(`/events/activity_brisk_walk/unlock/${id}/${siteId}`);
  },
  // 随机，每日答题
  getEverydayQuestion:(id) =>{
  	return getRequest(`/events/activity_brisk_walk/everyday/question/${id}`);
  },
  // 查看每日答题 详情
  getEverydayQuestionDetail:(walkFeatureId) =>{
  	return getRequest(`/events/activity_brisk_walk/get/already/answer/${walkFeatureId}`);
  },
  // 健步走答案提交
  getAnswerList: (param) => {
    return postRequest('/events/activity_brisk_walk/answer', param);
  },
  // 随手拍 关联活动
  snapshotList: (param) => {
    return postRequest('/events/activity_brisk_walk/look/snapshot', param);
  },
  // 添加随手拍
  snapshotAdd: (param) => {
    return postRequest('/events/activity_brisk_walk/save/user/snapshot', param);
  },
  // 个人排行榜、今日排行榜
  userRanking: (param) => {
    return postRequest('/events/activity_brisk_walk/user/rank', param);
  },
  // 单位排行榜
  orgRanking:(id) =>{
  	return getRequest(`/events/activity_brisk_walk/org/rank/${id}`);
  },
  // 随手拍（单独页） 
  getSnapshotList:(param) =>{
  	return getRequest(`/events/activity_snapshot/page`, param);
  },
  // 获取随手拍信息
  getSnapshotInfo:(id) =>{
  	return getRequest(`/events/activity_snapshot/${id}`);
  },
  // 随手拍 （单独）发布
  getSnapshotAdd: (param) => {
    return postRequest('/events/activity_snapshot', param);
  },
  // 随手拍详情 
  getSnapshotDetail: (param) => {
    return postRequest('/events/activity_snapshot/look/snapshot', param);
  },
  // 随手拍点赞/取消
  snapshotGiveOrCancel:(id) =>{
  	return getRequest(`/events/user_snapshot/give/or/cancel/${id}`);
  },
  // 发布评论
  applyComment: (param) => {
    return postRequest('/events/user_snapshot/apply/comment', param);
  },
  // 随手拍详情
  commentDetail:(id) =>{
  	return getRequest(`/events/user_snapshot/${id}`);
  },
  // 评论点赞或取消
  commentLike:(id) =>{
  	return getRequest(`/events/user_snapshot/give/or/cancel/comment/${id}`);
  },
  // 删除评论
  removeComment:(id) =>{
  	return getRequest(`/events/user_snapshot/remove/comment/${id}`);
  },
  // 知识竞赛列表（单独页）
  getCompetitionList:(param) =>{
  	return getRequest(`/events/activity_knowledge_contest/page`, param);
  },
  // 知识竞赛详情(单独页)
  getCompetitionDetail:(id) =>{
  	return getRequest(`/events/activity_knowledge_contest/${id}`);
  },
  // 参与活动 （单独的）
  getCompetitionJoin:(id) =>{
  	return getRequest(`/events/activity_knowledge_contest/join/${id}`);
  },
  // 知识竞赛答题 (单独的)
  questionCommit: (param) => {
    return postRequest('/events/activity_knowledge_contest/answer', param);
  },
  // 查找健步走用户行程
  getUserJourneyList:(id) =>{
  	return getRequest(`/events/user_journey/list/${id}`);
  },
 
  
  // 我的卡片
  getMyCard:(id) =>{
  	return getRequest(`/events/activity_brisk_walk/self/card/${id}`);
  },
};